package com.esd.device.task;

import com.esd.common.utils.SpringUtils;
import com.esd.device.service.EsdLogService;
import lombok.extern.slf4j.Slf4j;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.scheduling.quartz.QuartzJobBean;

@Slf4j
@DisallowConcurrentExecution // 禁止任务并发运行
public class EsdLogJob extends QuartzJobBean {

    private final static EsdLogService esdLogService = SpringUtils.getBean(EsdLogService.class) ;

    @Override
    protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
        esdLogService.deleteEsdLog();
    }
}
